const Mock = require('mockjs')

const data = Mock.mock({
  'orgData|3': [
    {
      id: '@id',
      label: '@cname',
      children: [
        {
          id: '@id',
          label: '@cname',
          code: '@id',
          type: '@integer(1,3)',
          version: '3.0',
          children: [
            {
              id: '@id',
              label: '@cname',
              code: '@id',
              type: '@integer(1,3)',
              version: '1.0',
              children: [
                {
                  id: '@id',
                  label: '@cname',
                  code: '@id',
                  type: '@integer(1,3)',
                  version: '2.0'
                }
              ]
            }
          ]
        }
      ]
    }
  ]
})
module.exports = [
  {
    url: '/permission/managerGroup/getParentGroupFunction',
    type: 'get',
    response: (config) => {
      const items = data.orgData
      return {
        code: '00000',
        success: Boolean(),
        message: '@word(5)',
        data: items
      }
    }
  }
]
